<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //情况1：在使用字面量创建数组出现空字符串
        var arr1 = [1,2, ,4];
        console.log(arr1);

        //情况2：在new Array() 中传入数组长度的参数
        var arr2 = new Array(4);
        console.log(arr2);

        //情况3：为数组添加索引不连续的元素
        var arr3 = [1];
        arr3[3] = 4;
        console.log(arr3);
        
        //情况4：修改数组长度大于原数组长度
        var arr4 = [1,2];
        arr4.length = 4;
        console.log(arr4);
    </script>
</head>
<body>
    
</body>
</html>